﻿#pragma once
#include "../CommonIOStuct.h"

struct _st_female
{
	bool m_b_female = false;
};

struct _st_martial
{
	short m_n_martial = 0;
};

struct _st_diplomacy
{
	short m_n_diplomacy = 0;
};

struct _st_intrigue
{
	short m_n_intrigue = 0;
};

struct _st_stewardship
{
	short m_n_stewardship = 0;
};

struct _st_learning
{
	short m_n_learning = 0;
};

struct _st_dna
{
	std::wstring m_wstr_dna;
};

struct _st_properties
{
	std::wstring m_wstr_properties;
};

struct _st_dynasty
{
	int m_n_dynasty = 0;
};

struct _st_trait
{
	std::list<std::wstring> m_list_trait;
};

struct _st_father
{
	int m_n_father = 0;
};

struct _st_mother
{
	int m_n_mother = 0;
};

struct _st_occluded
{
	bool m_b_occluded = false;		// 穆圣不能显示头像
};

struct _st_Date
{
	_stDate m_Date;
};

struct _st_birth
{
	bool m_b_birth = false;
};

struct _st_death
{
	bool m_b_death = false;
};

struct _st_death_reason
{
	std::wstring m_wstr_death_reason;
};

struct _st_killer
{
	int m_n_killer = 0;
};

struct _st_employer
{
	int m_n_employer = 0;
};

struct _st_add_spouse
{
	std::list<int> m_list_add_spouse;		// 增加配偶
};

struct _st_remove_spouse
{
	std::list<int> m_list_remove_spouse;		// 移除配偶
};

struct _st_add_matrilineal_spouse
{
	std::list<int> m_list_add_matrilineal_spouse;		// 增加入赘婚姻
};

struct _st_remove_matrilineal_spouse
{
	std::list<int> m_list_remove_matrilineal_spouse;		// 移除入赘婚姻
};

struct _st_add_claim
{
	std::list<std::wstring> m_list_add_claim;		// 增加宣称
};

struct _st_remove_claim
{
	std::list<std::wstring> m_list_remove_claim;		// 移除宣称
};

struct _st_give_nickname
{
	std::list<std::wstring> m_list_give_nickname;		// 加称号
};

struct _st_location
{
	int m_n_location = 0;		// 位置
};

struct _st_force_mult
{
	float m_f_force_mult = 1.0f;		// 税收加成
};

struct _st_raise_levies : public
	_st_location,			// int m_n_location						位置
	_st_force_mult			// float m_f_force_mult					税收加成
{};

struct _st_Annals : public		// 年表
	_st_Date,			// _stDate m_Date   排序依据
	_st_IndexName,		// std::wstring m_wstr_IndexName					名字索引名
	_st_birth,			// bool m_b_birth
	_st_death,			// bool m_b_death
	_st_death_reason,	// std::wstring m_wstr_death_reason
	_st_killer,			// int m_n_killer
	_st_employer,		// int m_n_employer
	_st_religion,		// std::wstring m_wstr_religion						宗教
	_st_culture,		// std::wstring m_wstr_culture						文化
	_st_add_spouse,		// std::list<int> m_list_add_spouse					增加配偶
	_st_remove_spouse,	// std::list<int> m_list_remove_spouse				移除配偶
	_st_add_matrilineal_spouse,		// std::list<int> m_list_add_matrilineal_spouse			增加入赘婚姻
	_st_remove_matrilineal_spouse,	// std::list<int> m_list_remove_matrilineal_spouse		移除入赘婚姻
	_st_add_claim,		// std::list<std::wstring> m_list_add_claim			增加宣称
	_st_remove_claim,	// std::list<std::wstring> m_list_remove_claim		移除宣称
	_st_give_nickname,	// std::list<std::wstring> m_list_give_nickname		加称号
	_st_trait			// std::list<std::wstring> m_list_trait
{
public:
	bool operator < (const _st_Annals& ti) const {
		return m_Date < ti.m_Date;
	}

	std::list<_st_raise_levies> m_list_raise_levies;
};

struct _stCharactersPorperty : public
	_st_id,								// int m_id										Key id
	_st_female,							// bool m_b_female
	_st_IndexName,						// std::wstring m_wstr_IndexName				名字索引名
	_st_diplomacy,						// m_n_diplomacy								外交
	_st_martial,						//	m_n_martial									军事
	_st_stewardship,					//	m_n_stewardship								理财
	_st_intrigue,						//	m_n_intrigue								密谋
	_st_learning,						//	m_n_learning								学识
	_st_culture,						// std::wstring m_wstr_culture					文化
	_st_religion,						// std::wstring m_wstr_religion					宗教
	_st_dynasty,						// int m_n_dynasty
	_st_trait,							// std::list<std::wstring> m_list_trait
	_st_father,							// int m_n_father
	_st_mother,							// int m_n_mother
	_st_occluded,						// bool m_b_occluded							穆圣不能显示头像
	_st_dna,							// std::wstring m_wstr_dna
	_st_properties						// std::wstring m_wstr_properties
{
	std::list<_st_Annals> m_list_Annals;		// 年表
};

class CCharactersPorperty
{
	friend class CScriptDataMgr;	// 只有CScriptDataMgr能实例化
public:
	~CCharactersPorperty() = default;
private:
	CCharactersPorperty() = default;
	CCharactersPorperty(const CCharactersPorperty&) = delete;
	CCharactersPorperty& operator=(const CCharactersPorperty&) = delete;

	bool CheckDataCompleteNSortList();	// 检查map中所有数据是否都不为空 并给年表按时间排序
private:
	std::unordered_map<int, _stCharactersPorperty> m_mapCharacterPorperty;
};